class User:
    def __init__(self, first_name, last_name, age, sex):
        self.first_name = first_name
        self.last_name = last_name
        self.age = age
        self.sex = sex
        self.login_attempts = 0

    def describe_user(self):
        print('User profile:')
        print('\t' + 'first name: ' + self.first_name)
        print('\t' + 'last name: ' + self.last_name)
        print('\t' + 'age: ' + str(self.age))
        print('\t' + 'sex: ' + self.sex)

    def greet_user(self):
        print('Hello!' + self.first_name + ' ' + self.last_name + '.')

    def increment_login_attempts(self):
        self.login_attempts += 1

    def reset_login_attempts(self):
        # 将属性login_attempts置0
        self.login_attempts = 0


user = User('Albert', 'Einstein', 76, 'male')
user.increment_login_attempts()
user.increment_login_attempts()
user.increment_login_attempts()
print(user.login_attempts)
user.reset_login_attempts()
print(user.login_attempts)
